package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GoodsDao {

    List<Goods> listInventory(@Param("offset") Integer offset,
                             @Param("rows") Integer rows,
                              @Param("codeOrName") String codeOrName,
                              @Param("goodsTypeId") Integer goodsTypeId);


    Long getTotal();

    void save(Goods goods);

    void update(Goods goods);

    Goods getById(Integer goodsId);

    void deleteById(Integer goodsId);

    List<Goods> getTotalOfNo(@Param("offset")Integer offset,
                             @Param("rows")Integer rows,
                             @Param("nameOrCode")String nameOrCode);

    List<Goods> getHasInventoryQuantity(@Param("offset")Integer offset,
                                        @Param("rows")Integer rows,
                                        @Param("nameOrCode")String nameOrCode);

    Integer countNoInventoryQuantity(@Param("nameOrCode")String nameOrCode);

    Integer countHasInventoryQuantity(@Param("nameOrCode")String nameOrCode);

    List<Goods> listAlarm();

}
